home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-04 / bipl.zip / PROGS.ZIP / CRYPT.ICN < prev    next >
Text File  |  1992-09-28  |  1KB  |  43 lines

  1. ############################################################################
  2. #
  3. #    File:     crypt.icn
  4. #
  5. #    Subject:  Program to encript file
  6. #
  7. #    Author:   Phil Bewig
  8. #
  9. #    Date:     May 5, 1992
  10. #
  11. ###########################################################################
  12. #
  13. #  Do *not* use this in the face of competent cryptanalysis.
  14. #
  15. # usage:  [iconx] icrypt [key] <infile >outfile
  16. #
  17. ############################################################################
  18. #
  19. #  As written, uses UNIX-style console I/O.
  20. #
  21. ############################################################################
  22.  
  23. procedure main(args)
  24.     local i, k, ky, l, con
  25.  
  26.     if *args = 1 then
  27.         ky := get(args)
  28.     else {
  29.         con := open("/dev/tty", "b")
  30.         writes(con, "Enter password:  ")
  31.         # NOTE:  displays password!
  32.         ky := read(con)
  33.         close(con) }
  34.     i := 1
  35.     l := 0
  36.     k := []
  37.     every put(k, ord(!ky)) do
  38.         l +:= 1
  39.     while writes(char(ixor(ord(reads()), k[i]))) do
  40.         i %:= l + 1
  41. end
  42.  
  43.